package com.ft.core.exceptions;

import com.ft.core.exceptions.inner.FanTuException;

/**
 * @copyright (C), 2015-2019, XXX有限公司
 * @fileName: NotLoginException
 * @author: 李阳
 * @date: 2019/5/14 12:10
 * @description: 未登录异常
 * @history: <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
public class NotLoginException extends FanTuException {
    private static final long serialVersionUID = -8127467116521249803L;

    /**
     * 无构造实例化
     */
    public NotLoginException() {
        super();
        this.setCode(AuthorizationErrorCode.USER_NOT_LOGIN);
    }

    /**
     * 实例化
     *
     * @param message 消息
     */
    public NotLoginException(String message) {
        super(message);
        this.setCode(AuthorizationErrorCode.USER_NOT_LOGIN);
    }

    /**
     * 实例化
     *
     * @param message 消息
     * @param cause   源异常
     */
    public NotLoginException(String message, Throwable cause) {
        super(message, cause);
        this.setCode(AuthorizationErrorCode.USER_NOT_LOGIN);
    }

    /**
     * 实例化
     *
     * @param cause 源异常
     */
    public NotLoginException(Throwable cause) {
        super(cause);
        this.setCode(AuthorizationErrorCode.USER_NOT_LOGIN);
    }

    /**
     * 实例化
     *
     * @param message            消息
     * @param cause              源异常
     * @param enableSuppression
     * @param writableStackTrace 写入跟踪
     */
    protected NotLoginException(String message, Throwable cause, boolean enableSuppression,
                                            boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
        this.setCode(AuthorizationErrorCode.USER_NOT_LOGIN);
    }

    @Override
    public final ExceptionLevel getLevel() {
        return ExceptionLevel.APPLICATION;
    }
}
